package com.mach.platform.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 母排报警信息实体
 */

@ExcelTarget("alarmMessageExcel")
@Entity
@Data
@Table(name = "alarm_message")
public class AlarmMessage implements Serializable {

    private static final long serialVersionUID = 1L;
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    private Long id;

    /**
     * 报警时间
     */
    @Excel(name = "时间", format = "yyyy-MM-dd HH:mm:ss", isImportField = "true_st", height = 20, width = 30)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "alarm_message_time")
    private LocalDateTime alarmMessageTime;

    /**
     * 报警车间
     */
    @Excel(name = "报警车间", height = 20, width = 30)
    @Column(name = "alarm_workshop")
    private String alarmWorkshop;

    /**
     * 车间id
     */
    @Column(name = "workshop_id")
    private Integer workshopId;

    /**
     * 母线编号
     */
    @Excel(name = "母线编号", height = 20, width = 30)
    @Column(name = "bus_number")
    private String busNumber;

    /**
     * 开关编号
     */
    @Excel(name = "开关编号", height = 20, width = 30)
    @Column(name = "switch_number")
    private String switchNumber;

    /**
     * 报警项目
     */
    @Excel(name = "报警项目", height = 20, width = 30)
    @Column(name = "alarm_term")
    private String alarmTerm;

    /**
     * 报警分类
     */
    @Excel(name = "报警分类", height = 20, width = 30)
    @Column(name = "alarm_classify")
    private String alarmClassify;

    /**
     * 报警值
     */
    @Excel(name = "报警值°C", height = 20, width = 30)
    @Column(name = "alarm_value")
    private Double alarmValue;

    /**
     * 是否处理（0：未处理(默认)，1：已处理）
     */
    @Column(name = "is_operation", columnDefinition = "INT default 0")
    private Integer isOperation;

    /**
     * 处理人
     */
    @Column(name = "deal_people")
    private String dealPeople;

    /**
     * 处理结果
     */
    @Column(name = "deal_result")
    private String dealResult;

    /**
     * 设备编号
     */
    @Column(name = "dev_name")
    private String devName;

}
